<?php
// +----------------------------------------------------------------------
// | 一机一码 [ 公众号和小程序运营管理系统 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2017 http://www.bctos.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: ouyangessen
// +----------------------------------------------------------------------

namespace app\admin\model;

use app\common\model\Base;

/**
 * 权限管理模型
 */
class Soft extends Base
{
    function getPHPEext($docker)
    {
        $exts = [
            'amqp' => [[55, 56, 70, 71, 72, 73, 74], '提供统一消息服务的应用层标准高级消息队列协议'],
            'apcu' => [[55, 56, 70, 71, 72, 73, 74, 80], '脚本缓存器'],
            'apcu_bc' => [[70, 71, 72, 73, 74], '脚本缓存器'],
            'bcmath' => [[55, 56, 70, 71, 72, 73, 74, 80], '浮点型的数据计算'],
            'bz2' => [[55, 56, 70, 71, 72, 73, 74, 80], '解压缩'],
            'calendar' => [[55, 56, 70, 71, 72, 73, 74, 80], '儒略日计数'],
            'cmark' => [[70, 71, 72, 73, 74]],
            'dba' => [[55, 56, 70, 71, 72, 73, 74, 80]],
            'decimal' => [[70, 71, 72, 73, 74]],
            'enchant' => [[55, 56, 70, 71, 72, 73, 74, 80]],
            'exif' => [[55, 56, 70, 71, 72, 73, 74, 80], '用于读取图片EXIF信息'],
            'ffi' => [[74, 80]],
            'gd' => [[55, 56, 70, 71, 72, 73, 74, 80], 'GD图片库'],
            'gettext' => [[55, 56, 70, 71, 72, 73, 74, 80], '国际化支持'],
            'gmagick' => [[55, 56, 70, 71, 72, 73, 74]],
            'gmp' => [[55, 56, 70, 71, 72, 73, 74, 80]],
            'grpc' => [[55, 56, 70, 71, 72, 73, 74]],
            'http' => [[55, 56, 70, 71, 72, 73, 74]],
            'igbinary' => [[55, 56, 70, 71, 72, 73, 74, 80]],
            'imagick' => [[55, 56, 70, 71, 72, 73, 74]],
            'imap' => [[55, 56, 70, 71, 72, 73, 74, 80], '邮件服务器必备'],
            'interbase' => [[55, 56, 70, 71, 72, 73]],
            'intl' => [[55, 56, 70, 71, 72, 73, 74, 80], '提供国际化支持'],
            'ldap' => [[55, 56, 70, 71, 72, 73, 74, 80]],
            'mailparse' => [[55, 56, 70, 71, 72, 73, 74, 80]],
            'mcrypt' => [[55, 56, 70, 71, 72, 73, 74]],
            'memcache' => [[55, 56, 70, 71, 72, 73, 74]],
            'memcached' => [[55, 56, 70, 71, 72, 73, 74, 80], '内存级缓存，比memcache支持更多高级功能'],
            'mongo' => [[55, 56]],
            'mongodb' => [[55, 56, 70, 71, 72, 73, 74]],
            'mosquitto' => [[55, 56, 70, 71, 72, 73, 74]],
            'msgpack' => [[55, 56, 70, 71, 72, 73, 74]],
            'mssql' => [[55, 56]],
            'mysql' => [[55, 56]],
            'mysqli' => [[55, 56, 70, 71, 72, 73, 74, 80]],
            'oauth' => [[55, 56, 70, 71, 72, 73, 74]],
            'odbc' => [[55, 56, 70, 71, 72, 73, 74]],
            'opcache' => [[55, 56, 70, 71, 72, 73, 74, 80], '内存级缓存，用于加速PHP脚本'],
            'opencensus' => [[70, 71, 72, 73, 74]],
            'parallel' => [[71, 72, 73, 74]],
            'pcntl' => [[55, 56, 70, 71, 72, 73, 74, 80]],
            'pcov' => [[70, 71, 72, 73, 74, 80]],
            'pdo_dblib' => [[55, 56, 70, 71, 72, 73, 74]],
            'pdo_firebird' => [[55, 56, 70, 71, 72, 73, 74, 80]],
            'pdo_mysql' => [[55, 56, 70, 71, 72, 73, 74, 80]],
            'pdo_odbc' => [[55, 56, 70, 71, 72, 73, 74, 80]],
            'pdo_pgsql' => [[55, 56, 70, 71, 72, 73, 74, 80]],
            'pdo_sqlsrv' => [[70, 71, 72, 73, 74]],
            'pgsql' => [[55, 56, 70, 71, 72, 73, 74, 80]],
            'propro' => [[55, 56, 70, 71, 72, 73, 74]],
            'protobuf' => [[55, 56, 70, 71, 72, 73, 74, 80]],
            'pspell' => [[55, 56, 70]],
            'pthreads' => [[55, 56, 70, 71, 72, 73, 74, 80]],
            'raphf' => [[55, 56, 70, 71, 72, 73, 74, 80]],
            'rdkafka' => [[55, 56, 70, 71, 72, 73, 74]],
            'recode' => [[55, 56, 70, 71, 72, 73]],
            'redis' => [[55, 56, 70, 71, 72, 73, 74, 80], '基于内存亦可持久化的Key-Value数据库'],
            'shmop' => [[55, 56, 70, 71, 72, 73, 74, 80]],
            'snmp' => [[55, 56, 70, 71, 72, 73, 74, 80]],
            'snuffleupagus' => [[70, 71, 72, 73, 74]],
            'soap' => [[55, 56, 70, 71, 72, 73, 74, 80]],
            'sockets' => [[55, 56, 70, 71, 72, 73, 74, 80]],
            'solr' => [[55, 56, 70, 71, 72, 73, 74, 80]],
            'sqlsrv' => [[70, 71, 72, 73, 74]],
            'ssh2' => [[55, 56, 70, 71, 72, 73, 74]],
            'sybase_ct' => [[55, 56]],
            'sysvmsg' => [[55, 56, 70, 71, 72, 73, 74, 80]],
            'sysvsem' => [[55, 56, 70, 71, 72, 73, 74, 80]],
            'sysvshm' => [[55, 56, 70, 71, 72, 73, 74, 80]],
            'tdlib' => [[70, 71, 72, 73, 74]],
            'tidy' => [[55, 56, 70, 71, 72, 73, 74, 80]],
            'timezonedb' => [[55, 56, 70, 71, 72, 73, 74, 80]],
            'uopz' => [[55, 56, 70, 71, 72, 73, 74]],
            'uuid' => [[55, 56, 70, 71, 72, 73, 74, 80]],
            'wddx' => [[55, 56, 70, 71, 72, 73]],
            'xdebug' => [[55, 56, 70, 71, 72, 73, 74, 80], '开源的PHP程序调试器'],
            'xhprof' => [[55, 56, 70, 71, 72, 73, 74]],
            'xmlrpc' => [[55, 56, 70, 71, 72, 73, 74]],
            'xsl' => [[55, 56, 70, 71, 72, 73, 74, 80], 'xsl解析扩展'],
            'yaml' => [[55, 56, 70, 71, 72, 73, 74]],
            'zip' => [[55, 56, 70, 71, 72, 73, 74, 80]],
            'zookeeper' => [[55, 56, 70, 71, 72, 73, 74]]
        ];
        $docker = intval(str_replace('php', '', $docker));
        $res = [];
        foreach ($exts as $name => $vo) {
            if (in_array($docker, $vo[0])) {
                $res[$name] = isset($vo[1]) && !empty($vo[1]) ? $vo[1] : 'php官方扩展';
            }
        }
        return $res;
    }
}
